<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.*"%>
<%@ include file="../../common.jsp" %>
<html>
<head>
<title>领用单详细</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
</head>

<%
ArrayList tOrderDeptList = (ArrayList)request.getAttribute("orgware");
GSStocksBean sbean=(GSStocksBean)request.getAttribute("sbean");
ArrayList array=(ArrayList)request.getAttribute("sdbean");
String sd=(String)request.getAttribute("sdetailid");
GSOrganizationBean obean=(GSOrganizationBean)request.getAttribute("obean");
DecimalFormat df = new DecimalFormat("0.0000"); 
String state="";
%>

<body BGCOLOR="#f2f2f2" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="2" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black" >库存领用明细</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<form name="form1" id="form1" method="post">
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
        <td> 
            <table class=bg_table id=tableId    cellspacing=1 cellpadding=2 width=100% align=center border=0>
                <tbody> 
                <tr class="bg_column" height=20> 
                <td colspan="4">领用单整体信息</td>
                </tr>
                <tr class="bg_row_odd" height=20> 
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领用单编号</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_stocks_id() %>
                        <input type='hidden' id='stocksid' name='stocksid' value="<%=sbean.getGs_stocks_id() %>">
                    </td>
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领用单位</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_workcorp_name() %>
                    </td>
                </tr>
                <tr class="bg_row_odd" height=20>
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领取人</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_stocks_person() %>
                    </td>
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领取部门</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_stocks_dept()%>
                    </td>
                </tr>
                 <tr class="bg_row_odd" height=20> 
                    <td class=top align=middle>
                        <div align="center" class="txt_content">领取日期</div>
                    </td>
                    <td class=top>
                        <%=sbean.getGs_stocks_date() %>
                    </td>
                    <td class=top align=middle>
                    <div align="center" class="txt_content">出货单位</div>
                    </td>
                    <td class=top>
                    <%=obean.getGs_org_name() %>
                    </td>
                </tr>
                <tr class="bg_row_odd" height=20> 
                    <td class=top align=middle>
                        <div align="center" class="txt_content">备注</div>
                    </td>
                    <td class=top colspan="3"><%=sbean.getGs_stocks_remark() %></td>
                </tr>
          </tbody></table></td></tr>
          <tr>
          <td>
          <table id=mx class=bg_table cellspacing=1 cellpadding=2 width=100% align=center border=0>
          <tr class="bg_column" height=20> 
          <td colspan="9">详细明细<input type="hidden" id="currentrownum" value="<%=array.size()%>"></td>
          </tr>
          <tr class="bg_column" height=20>
          <td class=top align=middle>
          <div align="center" class="txt_content">编号</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">名称</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">型号</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">单价(元)</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">数量</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">合计(元)</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">状态</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">用途</div>
          </td>
          <td class=top align=middle>
          <div align="center" class="txt_content">备注</div>
          </td>
          </tr>
          <%
          for(int i=0;i<array.size();i++){
              GSStocksDetailBean sdbean=(GSStocksDetailBean)array.get(i);
              int a=i+2;
              if(sdbean.getGs_detail_id().equals(sd)){
          %>
          <tr class="bg_row_odd">
          <td class="top" align="center" width="14%" nowrap="nowrap">
          <div id='divsdetailmanid<%=a%>'><%=sdbean.getGs_manufacture_id()%></div>
          </td>
          <td class="top" align="center" width="15%" nowrap="nowrap">
          <div id='divsdetailmanname<%=a%>'><%=sdbean.getGs_manufacture_name()%></div>
          </td>
          <td class="top" align="center" width="13%" nowrap="nowrap">
          <div id='divsdetailmantype<%=a%>'><%=sdbean.getGs_manufacture_type()%></div>
          </td>
          <td class="top" align="center" nowrap="nowrap" width="10%">
          <div id='divsdetailunit<%=a%>' ><%=sdbean.getGs_detail_unitprice()%></div>
          </td>
          <td class="top" align="center" nowrap="nowrap" width="10%">
          <div id='divsdetailcount<%=a%>' ><%=sdbean.getGs_detail_count()%></div>
          </td>
          <td class="top" align="center" width="8%" nowrap="nowrap">
          <div id='divsdetailsum<%=a%>'><%=sdbean.getGs_detail_unitprice()*sdbean.getGs_detail_count()%></div>
          </td>
          <td class="top" align="center" width="8%" nowrap="nowrap">
          <%
          if(sdbean.getGs_detail_state().equals("0")){
              state="未纳入结算";
          }else if(sdbean.getGs_detail_state().equals("1")){
              state="已纳入结算";             
          }else if(sdbean.getGs_detail_state().equals("2")){
              state="已作废";
          }else if(sdbean.getGs_detail_state().equals("3")){
              state="已完成";
          }
          %>
          <div id='divsdetailstate<%=a%>'>
          <%=state%></div>
          </td>
          <td class="top" align="center" nowrap="nowrap">
          <div id='divsdetailuse<%=a%>' ><%=sdbean.getGs_detail_use()%></div>
          </td>
          <td class="top" align="center" nowrap="nowrap">
          <div id='divsdetailremark<%=a%>' ><%=sdbean.getGs_detail_remark()%></div>
          </td>
          </tr>
          <%} 
              }%>
          <tr class="bg_column" height=20> 
          <td class=top align=middle>
          <div align="center" class="txt_content">作废原因</div>
          </td>
          <td colspan="8"><input type="text" id="zfyy" name="zfyy" size="50" maxlength="50" value="调整作废">
          <font color="red"> *</font>
          </td>
          </tr>
          </table>
          <br>
          <div align="center">
          <input type="button" class="kuang" onclick="writeback();" value="确 定">&nbsp;
          <input type="button" class="kuang" onclick="javascript:window.close();" value="取 消"></div>
          </form>
          <script type="text/javascript">
          function find(a,b){
            var rootURL = "<%=response.encodeURL(request.getContextPath()+"/A181107.do")%>?sid="+a+"&did="+b;
            window.open(encodeURI(rootURL),"","height=600,width=950,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=yes");
        }
        function writeback(){
            var txt=document.form1.zfyy.value;
            if(Trim(txt)==""){
                alert("请输入作废原因");
                return;
            }
            window.returnValue=txt;
            window.close();
        }
          </script>
</body>
</html>